package net.xmmpp.uc.im.bootstrap.web.metrics;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class SimulationRequest {

    private Integer countX = 0;

    @Autowired
    private DemoMetrics demoMetrics;

    @Async("One")
    @Scheduled(fixedDelay = 1000)
    public void increase(){
        countX++;
        demoMetrics.counter.increment();
        demoMetrics.map.put("x", Double.valueOf(countX));
        System.out.println("increase countX : " + countX);
    }
}
